<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String basePath = request.getContextPath();
%>

<s:set id="roles" value="#request['ROLE_INFO']"></s:set>

<form id="pagerForm" method="post" action="<%=basePath%>/role/manager.action">
	<input type="hidden" name="page.curPage" value="<s:property value="#PAGE_LIST.curPage"/>" />
	<input type="hidden" name="page.pageSize" value="<s:property value="#PAGE_LIST.pageSize"/>" />
</form>



<div class="pageContent">

	<form method="post" action="<%=basePath%>/role/roleModify.action" class="pageForm required-validate" onsubmit="return validateCallback(this,dialogAjaxDone,'确认修改此角色信息?')">
		<!-- 页面字段值 -->
		<div class="pageFormContent" layoutH="56">

			<input type="hidden" id="rolesId" name="roles.rolesId" value="<s:property value="#roles.rolesId"></s:property>" />
			
			<div class="unit">
				<label>角色名称：</label> 
				<input type="text" class="required" id="rolesName" name="roles.rolesName" value="<s:property value="#roles.rolesName"></s:property>" />
			</div>

			<div class="unit">
				<label>角色代码：</label> <input type="text" id="rolesCode" class="required" readonly="readonly"
					name="roles.rolesCode"
					value="<s:property value="#roles.rolesCode"></s:property>" />
			</div>

			<div class="unit">
				<label>角色状态：</label>
				<select id="rolesStatus" name="roles.rolesStatus" default="<s:property value="#roles.rolesStatus"></s:property>">
					<s:iterator value="#roles.rolesStatusMapping" var="status">
						<option value="<s:property value="#status.key"/>"><s:property value="#status.value"/></option>
					</s:iterator>
				</select>
			</div>
			
			<div class="unit">
				<div layoutH="118">
					<table class="list" width="100%" targetType="navTab">
						<thead>
							<tr>
								<th width="80">资源名称</th>
								<th width="100">资源链接</th>
								<th width="100">资源状态</th>
								<th width="50">操作</th>
							</tr>
						</thead>
						<tbody>
							<s:iterator value="#request['ROLE_RESOURCES_INFO']" id="roleRes">
								<tr>
									<td><s:property value="#roleRes.resName"/></td>
									<td><s:property value="#roleRes.resAction"/></td>
									<td><s:text name="resources.status.%{#roleRes.resStatus}"/></td>
									<td>
										<a title="确认删除此条角色资源信息(此操作不可逆,请谨慎操作)?" target="ajaxTodo" href="<%=basePath%>/role/roleResDel.action?roleRes.roleResId=<s:property value="#roleRes.roleResId"/>" class="btnDel">删除</a>
									</td>
								</tr>
							</s:iterator>
						</tbody>
					</table>
				</div>
				<%@include file="/WEB-INF/page/common/pagination.jsp"%>
			</div>
			
			
		</div>
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
		</div>
	</form>
</div>